const jwt = require('jsonwebtoken')

module.exports = (req, res, next) => {
    jwt.verify(req.get('token'), 'xig', async (err) => {
    if(err) {
        res.json({
            code: 500,
            msg: '未登录',
            data: null
        })
    } else {
        next()
    }
    })
}